<?php

class Core_Model_Permission_Collection_Group extends Dcmp_Model_Collection_Strong {

    public function __construct() {
        parent::__construct();
        $this->setItemClass('permission/group');
        $this->from('{t}permission_group', 'a')
                ->select()->field('a.*');
    }

    public function filterBy($name, $arg) {
        switch ($name) {
            case 'areaid':
                $this->eq('a.area_id', ':areaId:s')->addParameter('areaId', $arg);
        }
        return $this;
    }

}